//

//table表格内容的转换,不需要render函数渲染
export const transList = (data) => {
  if (typeOf(data) !== "array") return [];
  const statusMap = {
    1: "排队准备",
    2: "执行中",
    3: "已完成",
    4: "异常已回滚",
  };
  return data.map((it) => {
    return {
      ...it,
      statusText: statusMap[it.status],
      isReloadText: it.isReload === "1" ? "是" : "非",
    };
  });
};

/**
 * scroll滚动到指定位置
 * @param {*} scrollNum
 * @param {*} target
 */
export const scrollToTop = (scrollNum, target) => {
  target.scrollTo({
    top: scrollNum,
    behavior: "smooth",
  });
};
